
import 'package:flutter/cupertino.dart';
import 'package:redux/redux.dart';

final reducerLogin = combineReducers<bool>([
  TypedReducer<bool, LoginSuccessAction>(_loginReducer),
  TypedReducer<bool, LogoutAction>(_logoutReducer)
]);

class LoginSuccessAction {
  final BuildContext context;
  final bool success;
  LoginSuccessAction(this.context, this.success);
}

bool _loginReducer(bool oldRes, LoginSuccessAction action) {
  return action.success;
}

bool _logoutReducer(bool oldState, LogoutAction action) => true;

class LogoutAction {
  final BuildContext context;
  LogoutAction(this.context);
}

